package cn.com.git.example.common;

import cn.com.git.example.common.base.BaseResultConstant;

/**
 * 通用接口结果常量枚举类
 * Created by zhangzhenfu on 2017/2/18.
 */
public enum ResultConstant implements BaseResultConstant {

    /**
     * 失败
     */
    FAILED(false, 0, "操作失败"),

    /**
     * 成功
     */
    SUCCESS(true, 1, "操作成功"),

    /**
     * 连接超时
     */
    TIME_OUT(false, -1, "操作超时"),;

    private boolean success;

    private int code;

    private String message;

    ResultConstant(boolean success, int code, String message) {
        this.code = code;
        this.message = message;
        this.success = success;
    }

    @Override
    public boolean getSuccess() {
        return success;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

}
